#ifndef __LAN8720A_BSP_H__
#define __LAN8720A_BSP_H__

#include "stm32f4x7_eth_conf.h"
#include "stm32f4x7_eth.h"
#include "../GPIO_BSP/gpio_bsp.h"
#include "../../Driver/Debug/debug_driver.h"

/* PHY接口 */
#define RMII_MODE


/*
ETH_MDIO -------------------------> PA2
ETH_MDC --------------------------> PC1
ETH_MII_RX_CLK/ETH_RMII_REF_CLK---> PA1
ETH_MII_RX_DV/ETH_RMII_CRS_DV ----> PA7
ETH_MII_RXD0/ETH_RMII_RXD0 -------> PC4
ETH_MII_RXD1/ETH_RMII_RXD1 -------> PC5
ETH_MII_TX_EN/ETH_RMII_TX_EN -----> PB11
ETH_MII_TXD0/ETH_RMII_TXD0 -------> PG13
ETH_MII_TXD1/ETH_RMII_TXD1 -------> PG14
ETH_NRST -------------------------> PI1
*/

#define ETH_MDIO_Port                 PortA
#define ETH_MDIO_Pin                  Pin2

#define ETH_MDC_Port                  PortC
#define ETH_MDC_Pin                   Pin1

#define ETH_RMII_REF_CLK_Port         PortA
#define ETH_RMII_REF_CLK_Pin          Pin1

#define ETH_RMII_CRS_DV_Port          PortA
#define ETH_RMII_CRS_DV_Pin           Pin7

#define ETH_RMII_RXD0_Port            PortC
#define ETH_RMII_RXD0_Pin             Pin4

#define ETH_RMII_RXD1_Port            PortC
#define ETH_RMII_RXD1_Pin             Pin5

#define ETH_RMII_TX_EN_Port           PortB
#define ETH_RMII_TX_EN_Pin            Pin11

#define ETH_RMII_TXD0_Port            PortG
#define ETH_RMII_TXD0_Pin             Pin13

#define ETH_RMII_TXD1_Port            PortG
#define ETH_RMII_TXD1_Pin             Pin14

#define ETH_NRST_Port                 PortI
#define ETH_NRST_Pin                  Pin1


/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
#define MAC_ADDR0                     2
#define MAC_ADDR1                     0
#define MAC_ADDR2                     0
#define MAC_ADDR3                     0
#define MAC_ADDR4                     0
#define MAC_ADDR5                     0


extern ErrorStatus WHT_ETH_BSP_Init(void);


#endif /* __LAN8720A_BSP_H__ */
